//
//  YYBasicAuthApiManager.m
//  YYNetWorkingCustoms
//
//  Created by liang on 2017/8/14.
//  Copyright © 2017年 liang. All rights reserved.
//

#import "YYBasicAuthApiManager.h"
#import "YYHTTPConst.h"

@interface YYBasicAuthApiManager ()<CTAPIManagerValidator>

@end
@implementation YYBasicAuthApiManager

- (instancetype)init {
    
    self = [super init];
    self.validator = self;
    return self;
}

#pragma mark - CTApiManager
- (NSString *)methodName {
    
    return nil;
}

- (NSString *)serviceType {
    
    return kCTServiceAuthonticationYY;
}

- (CTAPIManagerRequestType)requestType {
    
    return CTAPIManagerRequestTypeGet;
}
- (BOOL)shouldCache {
    
    return NO;
}

#pragma mark - CTAPIManagerValidator
- (BOOL)manager:(CTAPIBaseManager *)manager isCorrectWithParamsData:(NSDictionary *)data {
    
    return YES;
}

- (BOOL)manager:(CTAPIBaseManager *)manager isCorrectWithCallBackData:(NSDictionary *)data {
    NSString *code = data[@"code"];
    if (![code isEqualToString:@"100"]) {
        return NO;
    }
    return YES;
}

@end
